public class RecursiveTraversalBT {
    public static class Node{
        public int value;
        public Node left;
        public Node right;
        public Node(int v){
            value = v;
        }
    }

    public static void pre(Node head){
        if (head == null){
            return ;
        }

        System.out.println(head.value);
        pre(head.left);
        pre(head.right);
    }

    public static void in(Node head){
        if (head == null){
            return;
        }

        in(head.left);
        System.out.println(head.value);
        in(head.right);
    }

    public static void last(Node head){
        if (head == null){
            return;
        }

        last(head.left);
        last(head.right);
        System.out.println(head.value);
    }

    public static void main(String[] args) {
        Node node = new Node(1);
        node.left = new Node(2);
        node.right = new Node(3);
        node.left.left = new Node(4);
        node.left.right = new Node(5);
        node.right.left = new Node(6);
        node.right.right = new Node(7);

//        pre(node);

//        in(node);

        last(node);

    }
}
